#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, m, c[1001];
vector<ll> edge[1001];

bool dfs(ll x) {
	for (auto y : edge[x])
		if (!c[y]) {
			c[y] = 3 - c[x];
			if (!dfs(y))
				return false;
		}
		else
			if (c[x] == c[y])
				return false;
	return true;
}

bool check() {
	for (ll i = 1; i <= n; ++i)	
		if (!c[i]) {
			c[i] = 1;
			if (!dfs(i))
				return false;
		}
	return true;
}

int main() {
	scanf("%lld%lld", &n, &m);
	for (ll i = 1; i <= m; ++i) {
		ll x, y;
		scanf("%lld%lld", &x, &y);
		edge[x].push_back(y);
		edge[y].push_back(x);
	}
	if (check())
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}
